You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(auth)!: return pagination info and lazy iterators from admin list_users - #2102
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Admin user listings now include pagination details alongside the users returned for the requested page.
Added synchronous and asynchronous iterators that fetch users page by page, with lazy retrieval.
Documentation
Updated the migration guide with the new paginated response format and guidance for using the iterators.
list_users() now returns a UserList with pagination metadata. The shared pagination validator reads total-count and link headers, and OAuth client listing uses it. Sync and async admin clients provide lazy page-by-page user iterators. The migration guide and SDK compliance entry document the response shape and iterator methods. Tests cover pagination metadata, iteration behavior, and updates to existing user-listing checks.
Sequence Diagram(s)
sequenceDiagram
participant Caller
participant SyncSupabaseAuthAdmin
participant _validate_paginated_model
Caller->>SyncSupabaseAuthAdmin: Iterate users with per_page
loop Each page
SyncSupabaseAuthAdmin->>SyncSupabaseAuthAdmin: Call list_users with page and per_page
SyncSupabaseAuthAdmin->>_validate_paginated_model: Validate response and pagination headers
_validate_paginated_model-->>SyncSupabaseAuthAdmin: Return UserList with pagination metadata
SyncSupabaseAuthAdmin-->>Caller: Yield users
end
Loading
Change: Feature
Merge Risk: Minimal · up to f7f64
admin.list_users() now returns a UserList with pagination metadata, and new iterators fetch users page by page. The breaking change is documented in the migration guide. No actionable merge-blocking risk was identified.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 42474649-18ce-4a6c-b963-ca4f2ed73dd7
Commits
Reviewing files that changed from the base of the PR and between 91aa96e and f7f6456.
Files selected for processing: 10
MIGRATION.md
sdk-compliance.yaml
src/auth/scripts/run-unasync.py
src/auth/src/supabase_auth/admin_api.py
src/auth/src/supabase_auth/helpers.py
src/auth/src/supabase_auth/types.py
src/auth/tests/_async/test_gotrue_admin_api.py
src/auth/tests/_async/test_list_users.py
src/auth/tests/_sync/test_gotrue_admin_api.py
src/auth/tests/_sync/test_list_users.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
admin.list_users()now returns the page together withnext_page,last_pageandtotal, and the admin clients can iterate over every user lazily.list_users()returnsUserList(users,aud, plusPagination) instead oflist[User]. Breaking, see MIGRATION.md.SyncSupabaseAuthAdmin.iter_users()andAsyncSupabaseAuthAdmin.aiter_users()fetch one page at a time.oauth.list_clients()and readspagefrom the query instead of splitting onpage=.SDK-2739